import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import Test from '../components/Test'
import Box from '../view/complex1/Box'
import Child1 from '../view/complex1/children/Child1'
import Child2 from '../view/complex1/children/Child2'
import Layout from '../view/layout/index'
import M1 from '../view/system/Child1'
import M2 from '../view/system/Child2'


Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/hello',
      name: 'HelloWorld',
      component: HelloWorld
    }, {
      path: '/test',
      name: 'Test',
      component: Test
    }, {
      path: '/box',
      name: 'Box',
      component: Box,
      children: [
        {
          path: 'child1',
          name: 'Child1',
          component: Child1
        }, {
          path: 'child2',
          name: 'Child2',
          component: Child2
        }
      ]
    }, {
      path: '/layout',
      name: 'Layout',
      component: Layout
    }, {
      path: '/system',
      name: 'System',
      component: Layout,
      children: [
        {
          path: 'm1',
          name: 'M1',
          component: M1
        }
        , {
          path: 'm2',
          name: 'M2',
          component: () => import('../view/system/Child2.vue')
        }
      ]
    }, {
      path: '/login',
      name: 'Login',
      component: () => import('../view/Login.vue') // 懒加载
    }, {
      path: '/hr/employee',
      name: 'Employee',
      component: () => import('../view/hr/employee.vue')
    }
  ]
})
